package com.bdqn.wx.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.bdqn.wx.service.UserService;


@Controller
@RequestMapping("/user")
public class UserController {
	
	@Autowired
    private	UserService userService; 
	
	
	@RequestMapping(value="/index/{id}")
	public ModelAndView index(@PathVariable("id") Integer id) {
		ModelAndView modelAndView = new ModelAndView();
		modelAndView.setViewName("index");
		modelAndView.addObject("imgSrc", userService.getImg(id).getImgSrc());
//		modelAndView.addObject("name", "hello");
		return modelAndView;
	}

	
	@RequestMapping(value="index")
	public String comment(){
		
		return "";
	}
	
	
}
